<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style outline-style2">
    <div class="Showroom-parent" v-if="props.info.digitalShowroom">
      <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
    </div> 
    <img class="outline-parent-bg" :src="publicUrls + 'free/style8/Level1outlineStyle7Bg.webp'" alt="" />
    <div class="outline jy-style-height"  :class="{
          content3: !props.info.value && !props.info.remarks && !props.info.subTitle,

          content2: !props.info.value && !props.info.remarks && props.info.subTitle,
        }">
      <div class="content-tiitle" v-html="textType(props.info.text)"></div>

      <div class="outline-content" v-if="props.info.subTitle || props.info.value || props.info.remarks">
        <p class="outline-subTitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
        <div
          class="cover"
          :class="{
            'img-box-1': !props.info.subTitle && props.info.remarks,
            'img-box-2': props.info.subTitle && !props.info.remarks,
            'img-box-3': !props.info.subTitle && !props.info.remarks,
          }"
          v-if="props.info.value"
        >
          <img
            class="outline-cover"
            @click="ImgVisible = true"
            :src="urls + props.info.value + '?imageView2/3/format/webp'"
            alt=""
          />
        </div>
        <div class="remarks1" v-if="props.info.value && props.info.remarks">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="getRemarksNum(3, route.meta.loopType)"
          ></TextMax>
        </div>
        <div
          class="remarks2"
          :class="{
            remarks3: !props.info.subTitle,
          }"
          v-else-if="props.info.remarks"
        > 
          <TextMax 
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks" 
            :title="props.info.text"
            :row="getRemarksNum(9, route.meta.loopType)"
          ></TextMax>
        </div>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free8Style3',
});
</script>

<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import { publicUrls, textType } from '@/utils/minxin';
import { getTextHtml } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style8.vue';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { useProjectStore } from '@/store';
import { transform } from 'lodash';
import { useRouter, useRoute } from 'vue-router';
const ImgVisible = ref(false);
const store = useProjectStore();

const route = useRoute();
const props = defineProps({
  info: { 
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 90px;
  margin-top: 0;
  margin-left: 120px;
  .Showroom-parent {
    position: absolute;
    top: 20px;
    right: 72px;
    z-index: 23;
  }
}
.outline-parent-bg {
  width: 636px;
  height: 100%;
  position: relative;
  z-index: 20;
}
.outline {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-direction: column;
  width: 100%; 
  padding: 120px 108px 78px 91px;
}
.content3{
  padding-top: 299px;
}
.content2{
padding-top: 265px;
}
.content-tiitle {
  height: 303px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  padding-bottom: 7px;
  border-left: 2px solid rgba(79, 110, 92, 0.6);
  border-right: 2px solid rgba(79, 110, 92, 0.6);

  ::v-deep p {
    height: 100%;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 4px;
    color: #4f6e5c;
    text-align: center;
    font-family: 'SourceHanSerifCN-Bold';
    font-size: 32px;
    line-height: 36px;
    &:nth-child(2) {
      position: relative;
      margin-left: 10px;
    }
    // &:nth-child(2)::after {
    //   content: '';
    //   width: 1px;
    //   height: 100%;
    //   background: #4f6e5c;
    //   position: absolute;
    //   top: 0;
    //   left: 0;
    // }
  }
}

.outline-content {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  margin-top: 20px;
  overflow: hidden;
  .outline-subTitle {
    width: 437px;
    color: rgba(79, 110, 92, 0.8);
    text-align: center;
    font-family: 'SourceHanSerifCN';
    font-size: 18px;
    line-height: 24px;
    margin-bottom: 20px;
  }
  .cover-height {
    // margin-top: 22px;
    // margin-bottom: 24px;
  }
  .cover {
    display: flex;
    align-items: center;
    width: 437px;
    height: 195px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #746d63;
    &:hover img {
      transform: scale(1.2);
    }
    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      transition: all 0.3s ease;
    }
  }
}
.img-box-1 {
  width: 437px;
  height: 257px;
}
.img-box-2 {
  width: 437px;
  height: 300px;
}
.img-box-3 {
  width: 437px;
  height: 322px;
}
.remarks1 {
    display: flex;
  width: 437px;
}
.remarks2 {
    display: flex;
  width: 437px;
}
::v-deep .textMore-box {
  width: 437px;
  
}
::v-deep .van-text-ellipsis {
  font-family: PingFangSC !important; 
  font-size: 16px !important;
  color: rgba(0, 0, 0, 0.59) !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #345746 !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
</style>